<?php

/**
 * Description of PricingTableWidget
 *
 * @author Poh Nean
 */
class PricingTableWidget extends CWidget
{
    
    public function init() {
        
    }
    
    public function run() {           
        $criteria = new CDbCriteria();
        $criteria->order = "price ASC";
        
        $data = array();
        $data["products"] = PsProduct::model()->findAll($criteria);
        $data["productsCount"] = count($data["products"]);
        $data["costPerSms"] = PsActionCost::getCostOfAction('sms');
        $data["costPerCase"] = PsActionCost::getCostOfAction('newCase');
        
        $this->render('pricingTableWidget', $data);
    }
}

?>
